Release 10.1A: OpenEdge Development:
Progress Dynamics Advanced Development


Special functions that manage properties

There are some special functions that let you define new properties at run time and also return useful information about standard object properties. This section describes the following functions.

instancePropertyList

This CHARACTER function returns a list of the names of the object’s instanceProperties, which are properties that can be set to initial values in design mode. You can set these properties in the AppBuilder or in the Container Builder to determine the object instance’s behavior at run time. The list of standard instance properties is part of the definition of the object and stored in its InstanceProperties property, described just below. If you pass in a blank (“”) for the INPUT parameter, you get back all instance properties and their values. Otherwise, you can pass in a comma-separated list of property names and get the values for just those properties back. If you want values for every property defined for the object, you can pass in an asterisk (“*”) as the INPUT parameter.

The RETURN value is a delimited list of property name/value pairs with CHR(3) between pairs and CHR(4) between name and value, as shown:

Function instancePropertyList: 
  Params: INPUT pcPropList AS CHARACTER. 
  Returns: property values. 
  Candidate for: calling 

propertyType

The propertyType CHARACTER function returns the data type of a property, as shown:

Function propertyType: 
  Params: INPUT pcPropName AS CHARACTER. 
  Returns: CHARACTER datatype of the property. 

setUserProperty

This LOGICAL function assigns a value to a dynamically defined property and allocates a slot for the property if it does not yet exist. You can use setUserProperty to create properties for SmartObjects on the fly, without having to define functions to support them or predefine them in any way. It takes as INPUT parameters the name of the property and the value. Because these ad hoc properties and values are simply stored in a delimited string within the SmartObject, the values are always represented in CHARACTER form, as shown:

Function setUserProperty: 
  Params: INPUT pcPropName AS CHARACTER,  
          INPUT pcPropValue AS CHARACTER. 
  Returns:  LOGICAL (always true) 
  Candidate for: calling 

getUserProperty

This LOGICAL function retrieves the value of a dynamically defined property that you previously defined and set with the setUserProperty function. The values for these functions are always stored and returned in CHARACTER form, as shown:

Function getUserProperty: 
  Params: INPUT pcPropName AS CHARACTER. 
  Returns:  CHARACTER property value. 
  Candidate for: calling 

InstanceProperties

This CHARACTER property returns the list of instance properties for the object. This list is normally hard-coded in the template for the object type as the xcInstance-Properties preprocessor, whose value is then assigned to InstanceProperties at startup of a static SmartObject. The value is also stored in the Repository for use with dynamic SmartObjects. In earlier product releases, this property was important for the AppBuilder to use when it generated code for use in its adm-create-object procedure. With dynamic windows, the distinction between instance properties and other properties is not as significant, and the value might not be meaningful for most applications.


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095